package org.hongqi.common.senpec.sys.dictionary;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.hongqi.common.senpec.base.mybatisplus.IBaseController;
import org.hongqi.common.senpec.base.sevlet.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;

@RestController
@RequestMapping("/sys/dictionaries")
@RequiredArgsConstructor
@Slf4j
public class DictionaryController implements IBaseController<Dictionary> {
    private final DictionaryService dictionaryService;

    @Override
    public Result<Dictionary> save(Dictionary entity) {
        dictionaryService.save(entity);
        return null;
    }

    @Override
    public Result<?> removeById(Long id) {
        return null;
    }

    @Override
    public Result<Dictionary> updateById(Dictionary entity) {
        return null;
    }

    @Override
    public Result<Dictionary> getById(Long id) {
        return dictionaryService.myGetById(id);
    }

    @Override
    public Result<Collection<Dictionary>> listObjsWithoutPage(Dictionary entity) {
        return dictionaryService.myListObjsWithoutPage(entity);
    }

    @Override
    public Result<Collection<Dictionary>> listTree(Dictionary entity) {
        return dictionaryService.myListTree(entity);
    }
}
